// GUI文件管理器 2025.6.28 create 
// todo 重构
// 内部改变文件夹路径事件
void onChangeEpath(string filepath)
{

}

int GuiMain()
{
	Window window = createWindow("FileManager",800,600);
	Hbox MenuBar = new Hbox();
	ImageButton back = new ImageButton("back.jpg");
	ImageButton forward = new ImageButton("forward.jpg");
	Text currentPath = new Text("");
	EditText search = new EditText();
	search.setPlaceHolder("search");
	MenuBar.add(back);
	MenuBar.add(forward);
	MenuBar.add(currentPaht);
	MeunBar.add(search);
	Vbox Root = new Vbox();
	Vbox leftSide = new Vbox();
	leftSide.add("computer>")
	string partitions[] = Os.getPartitionNames();
	Root.add(MenuBar);
	for(int i=0;i<partition;i++)
	{
		Button partitionButton = new Button();
		leftSide.add(partitionButton)
	}
	Root.add(side)
	Root.add(main)
	// 此处仿windows系统的控件样式底层
	FileListView flv = new FileListView();
	File f = new File(currentPath);
	for(File a:f.listDir())
	{
		if(a.isFile())
		{
			ImageButton file = new ImageButton("file.jpg");
			flv.add(image);
			file.setOnClick(new Button.onClickListener()
			{
				file.setBackgroundColor(Color.Blue);
			})
			//适配电脑端右键，手机端长按
			file.setOnMenuClick(new MenuClicker()
			{
				@Override
				public void onMenu()
				{
					Vbox Menu = new Vbox();
					Text open = new Text("open");
					Text cut = new Text("cut");
					Text copy = new Text("copy");
					Text rename = new Text("rename");
					Text properties = new Text("properties");
					
					Menu.add(open);
				}
			})
		}
		else if(a.isDir())
		{
			ImageButton image = new ImageButton("dir.jpg");
			flv.add(image);
				file.setOnClick(new Button.onClickListener()
			{
				file.setBackgroundColor(Color.Blue);
			})
		}
		
	}
	window.addRoot(Root);
}
void updatePath(string path)
{
	File ff = new File(path);
	for(File f:ff.listDir())
	{
	    if(a.isFile())
		{
			ImageButton file = new ImageButton("file.jpg");
			flv.add(image);
			file.setOnClick(new Button.onClickListener()
			{
				file.setBackgroundColor(Color.Blue);
			})
		}
		else if(a.isDir())
		{
			ImageButton image = new ImageButton("dir.jpg");
			flv.add(image);
				file.setOnClick(new Button.onClickListener()
			{
				file.setBackgroundColor(Color.Blue);
			})
		}
	}
}